<!--
 * @Description: 
 * @Author: chaixinyu
 * @Date: 2022-12-26 19:45:21
 * @LastEditors: 47
 * @LastEditTime: 2023-01-17 16:42:43
-->
<template>
  <div class="homework-test" >

    <!-- 导航栏 -->
    <van-nav-bar left-arrow @click-left="onClickLeft">

      <template #title>

        <div class="title1">
          <router-link class="homework" active-class="active" to="/homeworktest/homework">作业</router-link> 
          <router-link class="homework" active-class="active" to="/homeworktest/test">考试</router-link> 
        </div>

      </template>

    </van-nav-bar>

    <router-view></router-view>
  </div>
</template>

<script setup>
import { NavBar } from 'vant';

// 引入路由
import {useRouter} from 'vue-router'

// 实例化路由对象
const router = useRouter()

// 返回上一级
const onClickLeft = () => {
  router.push('/courseinfo/coursetask')
}
</script>

<style lang="less" scoped>
.homework-test{
  :deep(.van-icon) {
      color: black;
  }
  .title1{
    height: 22px;
    // background-color: pink;
    border: 1px solid #0098fb;
    border-radius: 4px;

    .active{
      font-size: 13px;
      color: #fefefe;
      background-color: #0098fb;
      padding: 2px 20px;
    }

    .homework{
      text-decoration: none;
      border-radius: 3px;
      font-size: 13px;
      padding: 4px 20px;
    }
  }
}
</style>
